<template>
  <div class="login">
    login
    <button @click="login">登录</button>
  </div>
</template>
<script>
import { routerRedirect } from '@/utils/router.js'
export default {
  name: 'Login',
  methods: {
    async login() {
      const params = {
        username: 'admin',
        password: '11'
      }
      const res = await this.$store.dispatch('login', params)
      console.log(res)
      if (res) {
        routerRedirect()
      }
    }
  }
}
</script>